﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using ZX.EHR.Library;
using ZX.BLL.Extend;
using ZX.DBModule;
using ZX.Web.UI.Controls;
using ZX.Common;
using System.Text;
using ZX.CRM.Library;
namespace ZX.WebApp.Crm.MeetingArrange
{
    public partial class ResourceManage : System.Web.UI.Page
    {
        //是否是修改
        private string _isEdit;
        public string isEdit
        {
            get { return _isEdit; }
            set { _isEdit = value; }
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            string id =Request.QueryString["id"].ToString();
            BaseEntity instance = ZX.Common.Globals.getEntity("V_CrmDeliverMajorProductLayout") as BaseEntity;
            BaseBussnies bInstance = new BLL.Extend.BaseBussnies(instance);
            BaseEntity entity = bInstance.GetEntityById(id) as BaseEntity;
            this.EditTemplate.Text = ZX.WebApp.Crm.Common.CreateJson.CreateHtml(instance, null);

           

            IList<EditUIConfig> list = bInstance.GetEntitys<EditUIConfig>("EntityName='CrmManagerSum'");
            this.jSave.Text = ZX.WebApp.Crm.Common.CreateJson.CreateScript(list, "instanceManagerSum");
            string condition = "DeliverMajorID='" + id + "'";
            IList<CrmManagerSum> ilist = bInstance.GetEntitys<CrmManagerSum>(condition);
            if (ilist != null && ilist.Count > 0)
            {
                isEdit = "True";
                BaseEntity instance1 = ilist[0] as BaseEntity;
                EditTemplate1.Text = ZX.WebApp.Crm.Common.CreateJson.CreateHtml(instance1, null, "instanceManagerSum");

            }
            else
            {
                BaseEntity instance1 = ZX.Common.Globals.getEntity("CrmManagerSum") as BaseEntity;
                EditTemplate1.Text = ZX.WebApp.Crm.Common.CreateJson.CreateHtml(instance1, null, "instanceManagerSum");
            }


        }
    
    }
}